l=eval(input())
i=0
list1=[]
while i<l:
    x=eval(input())
    list1.append(x)
    i+=1
m=max(list1)
print(m)
i=0
while i<l:
    if list1[i]==m:
        print(i+1)
    i+=1    